import runtime

fn map_new<T,U>():map<T,U> {
    int hash = @reflect_hash(map<T,U>)
    int key_hash = @reflect_hash(T)
    int value_hash = @reflect_hash(U)
    return runtime.map_new(hash, key_hash, value_hash) as map<T,U>
}

#linkid rt_map_length
fn map<T,U>.len():int

fn map<T,U>.del(T key) {
    rawptr<T> ref = &key
    runtime.map_delete(self as anyptr, ref as anyptr)
}

fn map<T,U>.contains(T key):bool {
    rawptr<T> ref = &key
    return runtime.map_contains(self as anyptr, ref as anyptr)
}
